<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Echarts尝鲜</title>
  <script src="https://cdn.bootcdn.net/ajax/libs/echarts/5.0.2/echarts.common.min.js"></script>
</head>
<body>
  <div style="width: 600px; height: 400px"></div>
  <script>
    let mCharts = echarts.init(document.querySelector('div'))
    let xDataArr = ['李老师','刘老师','王老师','杨老师','张老师','霍老师']
    let yDataArr = [99, 90, 87, 89, 68, 52]
    let option = {
      xAxis: {
        type: 'category',
        data: xDataArr
      },
      yAxis: {
        type: 'value'
      },
      series: [
        {
          name: 'Javascript Grades',
          type: 'bar',
          data: yDataArr,
          markPoint: {
            data: [
              {
                type: 'max',
                name: '最大值'
              }, {
                type: 'min',
                name: '最小值'
              }
            ]
          },
          markLine: {
            data: [
              {
                type: 'average',
                name: '平均值'
              }
            ]
          },
          label: {
            show: true,
            rotate: -30
          },
          barWidth: '40%'
        }
      ]
    }
    mCharts.setOption(option)
  </script>
</body>
</html>